import Taro, { Component } from '@tarojs/taro'
import { Image, View } from '@tarojs/components'
import './index.scss'

interface IProps {
  info: any
}

export default class Index extends Component<IProps, {}> {
  static options = {
    addGlobalClass: true
  }

  render() {
    const { info } = this.props
    return (<View className='comment-like'>
      <View className='praise-box d-f a-i-c'>
        {info.is_commonts_goods == 1 && <View className='praise-icon fy-icon-font active'>&#xe6e3;</View>}
        {info.is_commonts_goods !== 1 && <View className='praise-icon fy-icon-font'>&#xe644;</View>}
        {info.goods_num > 0 && <View className='praise-num'>{info.goods_num}</View>}
      </View>
      <View className='avatar-list'>
        {info.goods_user.map(user => {
          return (<View key={user.id} className='avatar-box'>
            <Image src={user.headimgurl} lazyLoad/>
          </View>)
        })}
      </View>
    </View>)
  }
}